package com.lxm;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

@SpringBootApplication
@EnableScheduling
public class LxmApplication {

	public static void main(String[] args) {
		SpringApplication.run(LxmApplication.class, args);
	}



	@Bean
	public TaskScheduler poolScheduler() {
		System.out.println("初始化线程池了----------------------");
		ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
		scheduler.setThreadNamePrefix("poolScheduler");
		scheduler.setPoolSize(5);
		return scheduler;
	}


}
